package realQuestion.zhongXin;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;

public class Main2 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String next = scanner.next();
        StringBuffer stringBuffer = new StringBuffer();
        HashMap<Character, Integer> characterIntegerHashMap = new HashMap<>();
        for (char a:
            next.toCharArray() ) {
            characterIntegerHashMap.put(a,characterIntegerHashMap.getOrDefault(a,0)+1);
        }
        Iterator<Map.Entry<Character, Integer>> iterator = characterIntegerHashMap.entrySet().iterator();
        while (iterator.hasNext()){
            Map.Entry<Character, Integer> next1 = iterator.next();
            if (next1.getValue()>2){
                stringBuffer.append(next1.getKey());
            }
        }
        System.out.println(stringBuffer.toString());


    }



}
